package com.jdz.gxq.info.admin.inspectiondetail.service;

import java.util.List;
import java.util.Map;

import jp.terasoluna.fw.dao.QueryDAO;
import jp.terasoluna.fw.dao.UpdateDAO;

import com.jdz.gxq.info.admin.inspectiondetail.bo.Inspectiondetail;

public class InspectiondetailServiceImpl implements InspectiondetailService {

	private QueryDAO queryDAO = null;

	private UpdateDAO updateDAO = null;

	/**
	 * Inspectiondetail检索分页用，查询记录条数
	 * 
	 * @return
	 */
	public int getInspectiondetailsCount() {

		int totalCount = queryDAO.executeForObject(
				"inspectiondetail.getInspectiondetailsCount", null,
				Integer.class);

		return totalCount;
	}

	/**
	 * Inspectiondetail检索
	 * 
	 * @return
	 */
	public List<Inspectiondetail> getInspectiondetails(
			Map<String, Object> params) {

		return queryDAO.executeForObjectList(
				"inspectiondetail.getInspectiondetails", params);
	}

	/**
	 * 追加Inspectiondetail
	 * 
	 * @param inspectiondetail
	 */
	public void insertInspectiondetail(Inspectiondetail inspectiondetail) {

		updateDAO.execute("inspectiondetail.insertInspectiondetail",
				inspectiondetail);
	}

	/**
	 * 更新Inspectiondetail
	 * 
	 * @param inspectiondetail
	 */
	public void updateInspectiondetail(Inspectiondetail inspectiondetail) {

		updateDAO.execute("inspectiondetail.updateInspectiondetail",
				inspectiondetail);
	}

	/**
	 * 通过id得到inspectiondetail
	 * 
	 * @param id
	 * @return
	 */
	public Inspectiondetail getInspectiondetailById(int id) {

		Inspectiondetail inspectiondetail = queryDAO.executeForObject(
				"inspectiondetail.getInspectiondetailById", id,
				Inspectiondetail.class);

		return inspectiondetail;
	}

	/**
	 * 删除Inspectiondetail
	 * 
	 * @param inspectiondetail
	 */
	public void deleteInspectiondetail(int id) {

		updateDAO.execute("inspectiondetail.deleteInspectiondetailById", id);
	}

	public void setQueryDAO(QueryDAO queryDAO) {
		this.queryDAO = queryDAO;
	}

	public void setUpdateDAO(UpdateDAO updateDAO) {
		this.updateDAO = updateDAO;
	}

}
